/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SupplierManager;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import main.ketnoi;

/**
 *
 * @author august
 */
public class supplier extends javax.swing.JPanel {

    Connection con;
    DefaultTableModel model;//model cho bang

    /**
     * Creates new form supplier
     */
    public supplier() {
        initComponents();
        ketnoi a = new ketnoi();
        con = a.connect();
        model = (DefaultTableModel) jt.getModel();
        loadData();
        //code auto for supplier
        t1.setEnabled(false);
        int num1 = jt.getRowCount();
        t1.setText("S" + (num1 + 1));

    }

    public void loadData() {
        try {

            PreparedStatement prst = con.prepareStatement("Select * from Suppliers");
            ResultSet rs = prst.executeQuery();
            while (rs.next()) {

//                jComboBox1.addItem(rs.getString(2));

                Vector b = new Vector();
                b.add(rs.getString(1));
                b.add(rs.getString(2));
                b.add(rs.getString(3));
                b.add(rs.getString(4));
                model.addRow(b);
            }
            cbsort.addItem("Choose");
            PreparedStatement st = con.prepareStatement("Select top 2 * from information_schema.columns where table_name = 'suppliers'");
            ResultSet rs1 = st.executeQuery();
            while (rs1.next()) {
                //lay du lieu cot thu 4: name,diem,lop
                String str1 = rs1.getString(4);
                cbsort.addItem(str1);

            }

        } catch (SQLException ex) {
            Logger.getLogger(supplier.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public static boolean checkPhone(String n) {
        if (n == null || n.length() > 15 || n.length() < 7) {
            return false;
        } else {
            String strPattern = "[^0-9]";
            Pattern p;
            Matcher m;
            int flag = Pattern.CASE_INSENSITIVE;
            p = Pattern.compile(strPattern, flag);
            m = p.matcher(n);
            return !m.find();
        }
    }

    public void reset() {
        t1.setText("");
        t2.setText("");
        t4.setText("");
        t3.setText("");
        t1.requestFocus();
        //code auto for supplier
        t1.setEnabled(false);
        int num1 = jt.getRowCount();
        t1.setText("S" + (num1 + 1));

    }

    public boolean checkSupplierCode() {
        try {
            if (t1.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "SupplierCode invalid");
                t1.setText("");
                t1.requestFocus();
                return false;
            }
            PreparedStatement pre = con.prepareStatement("select SupplierCode from Suppliers");
            ResultSet re = pre.executeQuery();
            while (re.next()) {
                if (t1.getText().equals(re.getString(1))) {
                    JOptionPane.showMessageDialog(this, "SupplierCode existed!", "ERROR", JOptionPane.ERROR_MESSAGE);
                    //code auto for CustomerCode
                    t1.setEnabled(false);
                    int num1 = jt.getRowCount();
                    Calendar now = Calendar.getInstance();
                    t1.setText("S" + (num1 + 1));
                    return false;
                }
            }
        } catch (SQLException ex) {
            Logger.getLogger(supplier.class.getName()).log(Level.SEVERE, null, ex);
        }
        return true;
    }

    public boolean checkSupplier() {
        if (t2.getText().equals("")) {
            JOptionPane.showMessageDialog(this, "Name invalid", "ERROR", JOptionPane.ERROR_MESSAGE);
            t2.setText("");
            t2.requestFocus();
            return false;
        } else if (t3.getText().equals("")) {
            JOptionPane.showMessageDialog(this, "Address invalid", "ERROR", JOptionPane.ERROR_MESSAGE);
            t3.setText("");
            t3.requestFocus();
            return false;
        } else if (t4.getText().equals("")) {
            JOptionPane.showMessageDialog(this, "Phone invalid", "ERROR", JOptionPane.ERROR_MESSAGE);
            t4.setText("");
            t4.requestFocus();
            return false;

        } else if (checkPhone(t4.getText()) == false) {
            JOptionPane.showMessageDialog(this, "Phone invalid", "ERROR", JOptionPane.ERROR_MESSAGE);
            t4.setText("");
            t4.requestFocus();
            return false;

        }
        return true;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt = new javax.swing.JTable();
        txtsearch = new javax.swing.JTextField();
        search = new javax.swing.JButton();
        cbsort = new javax.swing.JComboBox();
        sort = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        t1 = new javax.swing.JTextField();
        t2 = new javax.swing.JTextField();
        t3 = new javax.swing.JTextField();
        t4 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        add = new javax.swing.JButton();
        update = new javax.swing.JButton();
        reset = new javax.swing.JButton();

        setBackground(new java.awt.Color(231, 231, 231));
        setPreferredSize(new java.awt.Dimension(777, 702));

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SupplierList", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP));
        jPanel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jt.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Code", "Name", "Address", "Phone"
            }
        ));
        jt.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jt);

        search.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/search2.png"))); // NOI18N
        search.setText("Search");
        search.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchActionPerformed(evt);
            }
        });

        sort.setText("Sort");
        sort.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sortActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addComponent(sort, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(26, 26, 26)
                        .addComponent(cbsort, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(txtsearch, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(search, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(sort, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(search)
                        .addComponent(txtsearch)
                        .addComponent(cbsort, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(22, 22, 22)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SupplierDetail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP));

        jLabel2.setText("Code");

        jLabel3.setText("Name");

        jLabel4.setText("Address");

        jLabel5.setText("Phone");

        add.setText("Add");
        add.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addActionPerformed(evt);
            }
        });

        update.setText("Update");
        update.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                updateActionPerformed(evt);
            }
        });

        reset.setText("New");
        reset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(0, 49, Short.MAX_VALUE)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(t2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(add, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(77, 77, 77)
                        .addComponent(update, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(53, 53, 53)
                        .addComponent(reset, javax.swing.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
                        .addGap(49, 49, 49))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(170, 170, 170)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(28, 28, 28)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(162, Short.MAX_VALUE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(5, 5, 5)
                                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap(18, Short.MAX_VALUE)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(33, 33, 33)))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(add)
                    .addComponent(update)
                    .addComponent(reset))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(257, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void resetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetActionPerformed
        // TODO add your handling code here:
        this.reset();
        add.setEnabled(true);
    }//GEN-LAST:event_resetActionPerformed

    private void addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addActionPerformed
        if (checkSupplierCode() == true) {
            if (checkSupplier() == true) {
                try {
                    // TODO add your handling code here:
                    PreparedStatement prst = con.prepareStatement("insert into Suppliers values (?,?,?,?)");
                    prst.setString(1, t1.getText());
                    prst.setString(2, t2.getText());
                    prst.setString(3, t3.getText());
                    prst.setString(4, t4.getText());
                    prst.executeUpdate();

                    // Load lai co so du lieu
                    int num = jt.getRowCount();
                    for (int i = num - 1; i >= 0; i--) {
                        model.removeRow(i);
                    }
                    this.loadData();
                    this.reset();
                } catch (SQLException ex) {
                    Logger.getLogger(supplier.class.getName()).log(Level.SEVERE, null, ex);
                    JOptionPane.showMessageDialog(this, "Chua nhap du thong tin!\nThong tin nhap chua chinh xac!", "ERROR", JOptionPane.ERROR_MESSAGE);
                }
            }
        }

    }//GEN-LAST:event_addActionPerformed

    private void updateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateActionPerformed
        if (t1.getText().equals("")) {
            JOptionPane.showMessageDialog(this, "Please select User from table above");
        } else {
            if (checkSupplier() == true) {
                try {
                    // TODO add your handling code here:
                    PreparedStatement prst = con.prepareStatement("UPDATE Suppliers SET SupplierName=?,SupplierAddress=?,SupplierPhone=? WHERE SupplierCode=?");
                    prst.setString(1, t2.getText());
                    prst.setString(2, t3.getText());
                    prst.setString(3, t4.getText());
                    prst.setString(4, t1.getText());
                    prst.executeUpdate();
                    //Load lai CSDL
                    int num = jt.getRowCount();
                    for (int i = num - 1; i >= 0; i--) {
                        model.removeRow(i);
                    }
                    this.loadData();
                    this.reset();
                } catch (SQLException ex) {
                    Logger.getLogger(supplier.class.getName()).log(Level.SEVERE, null, ex);
                    JOptionPane.showMessageDialog(this, "Chua nhap du thong tin!\nThong tin nhap chua chinh xac!", "ERROR", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }//GEN-LAST:event_updateActionPerformed

    private void jtMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtMouseClicked
        // TODO add your handling code here:
        add.setEnabled(false);
        int r = jt.getSelectedRow();
        if (r < 0) {
            return;
        }
        t1.setText(jt.getValueAt(r, 0).toString());
        t2.setText(jt.getValueAt(r, 1).toString());
        t3.setText(jt.getValueAt(r, 2).toString());
        t4.setText(jt.getValueAt(r, 3).toString());
    }//GEN-LAST:event_jtMouseClicked

    private void searchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchActionPerformed
        if (cbsort.getSelectedIndex() == 0) {
            JOptionPane.showMessageDialog(this, "Please select search condition!");
        } else {
            try {
                // TODO add your handling code here:
                this.reset();
                int num = jt.getRowCount();
                for (int i = num - 1; i >= 0; i--) {
                    model.removeRow(i);
                }
                String str1 = cbsort.getSelectedItem().toString();
                String str = txtsearch.getText();
                PreparedStatement pst = con.prepareStatement("Select * from suppliers where " + str1 + " = ?");
                pst.setString(1, str);
                ResultSet rs1 = pst.executeQuery();
                while (rs1.next()) {
                    Vector b1 = new Vector();
                    b1.add(rs1.getString(1));
                    b1.add(rs1.getString(2));
                    b1.add(rs1.getString(3));
                    b1.add(rs1.getString(4));
                    model.addRow(b1);
                }
            } catch (SQLException ex) {
                Logger.getLogger(supplier.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_searchActionPerformed

    private void sortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sortActionPerformed
        if (cbsort.getSelectedIndex() == 0) {
            JOptionPane.showMessageDialog(this, "Please select sort condition");
        } else {
            try {
                // TODO add your handling code here:
                this.reset();
                int num = jt.getRowCount();
                for (int i = num - 1; i >= 0; i--) {
                    model.removeRow(i);
                }
                String str = cbsort.getSelectedItem().toString();
                PreparedStatement pst = con.prepareStatement("Select * from suppliers order by " + str);
                ResultSet rs1 = pst.executeQuery();
                Vector e = null;
                while (rs1.next()) {
                    e = new Vector();
                    e.add(rs1.getString(1));
                    e.add(rs1.getString(2));
                    e.add(rs1.getString(3));
                    e.add(rs1.getString(4));
                    model.addRow(e);
                }
            } catch (SQLException ex) {
                Logger.getLogger(supplier.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_sortActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton add;
    private javax.swing.JComboBox cbsort;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jt;
    private javax.swing.JButton reset;
    private javax.swing.JButton search;
    private javax.swing.JButton sort;
    private javax.swing.JTextField t1;
    private javax.swing.JTextField t2;
    private javax.swing.JTextField t3;
    private javax.swing.JTextField t4;
    private javax.swing.JTextField txtsearch;
    private javax.swing.JButton update;
    // End of variables declaration//GEN-END:variables
}
